package com.app.micaihu.view.main.dialog

import android.content.DialogInterface
import android.content.Intent
import com.app.base.BaseDialogFragment
import com.app.micaihu.R
import com.app.micaihu.app.AppApplication
import com.app.micaihu.view.main.game.GameDownloadActivity
import com.app.micaihu.view.utils.DownloadAgainUtils
import kotlinx.android.synthetic.main.dialog_undownload_game.*

class UnDownLoadGameDialogFragment : BaseDialogFragment() {
    companion object {
        @JvmStatic
        fun newInstance(): UnDownLoadGameDialogFragment {
            return UnDownLoadGameDialogFragment()
        }
    }

    override fun getLayoutId(): Int {
        return R.layout.dialog_undownload_game
    }

    override fun setData() {
    }

    override fun addListeners() {
        btnWifi.setOnClickListener {
            dismiss()
        }
        btnContinue.setOnClickListener {
            DownloadAgainUtils.downLoadGame()
            startActivity(Intent(context, GameDownloadActivity::class.java))
            dismiss()
        }
    }

    override fun canceledOnTouchOutside(): Boolean {
        return false
    }

    override fun cancelable(): Boolean {
        return false
    }

    override fun onDismiss(dialog: DialogInterface) {
        super.onDismiss(dialog)
    }
}